/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.rh.gui;

import com.rh.game.Character;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 *
 * @author Hayden
 */
public class RenderEvent {
    public static final List<RenderEvent> EMPTY_LIST = Collections.unmodifiableList(new ArrayList<RenderEvent>());
    
    public static final RenderEvent NULL = new RenderEvent(Type.NOTHING, "", Character.NULL);
    // public static final RenderEvent FINAL_SWAP = new RenderEvent(Type.FINAL_SWAP, "", Character.NULL);
    public static final RenderEvent GAME_OVER = new RenderEvent(Type.GAME_OVER, "", Character.NULL);
    
    public static enum Type  {
        CHAT, GENDER_SWAP, GAME_OVER, FEMALE_TO_MALE, MALE_TO_FEMALE, NOTHING, PLAYER_MOVES;
    }
    
    private Type type = null;
    public Type getType()  {
        return type;
    }
    
    private String id = "";
    public String getID()  {
        return id;
    }
    
    private Character character = Character.NULL;
    public Character getCharacter()  {
        return character;
    }
    
    private Character character2 = Character.NULL;
    public Character getCharacter2()  {
        return character2;
    }
    
    private RenderEvent(Type pType, String pID, Character pWhom)  {
        this(pType, pID, pWhom, Character.NULL);
    }
    private RenderEvent(Type pType, String pID, Character pWhom, Character pWhom2)  {
        super();
        type = pType;
        id = pID;
        character = pWhom;
        character2 = pWhom2;
    }
    
    
    public static RenderEvent chat(String pID)  {
        return new RenderEvent(Type.CHAT, pID, Character.NULL);
    }
    
    public static RenderEvent playerMovesTo(String pID)  {
        return new RenderEvent(Type.PLAYER_MOVES, pID, Character.NULL);
    }

    public static RenderEvent maleToFemale(Character pWhom)  {
        return new RenderEvent(Type.MALE_TO_FEMALE, "", pWhom);
    }
    
    public static RenderEvent femaleToMale(Character pWhom)  {
        return new RenderEvent(Type.FEMALE_TO_MALE, "", pWhom);
    }
    
    public static RenderEvent genderSwap(Character pWhom, Character pWhom2)  {
        return new RenderEvent(Type.GENDER_SWAP, "", pWhom, pWhom2);
    }
    
    public String toString()  {
        return getType() + ", " + getID();
    }
}
